package com.gitee.hljdrl.utils.mark;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

public class IDUtil {

    static AtomicLong ID_LONG = new AtomicLong(1000);

    static AtomicInteger ID_INT = new AtomicInteger(1000);

    public static long nextIdLong() {
        return ID_LONG.incrementAndGet();
    }

    public static int nextIdInt() {
        return ID_INT.incrementAndGet();
    }

    public static void resetInt(int newValue) {
        ID_INT.set(newValue);
    }

    public static void resetLong(long newValue) {
        ID_LONG.set(newValue);
    }

    public static void reset() {
        ID_INT.set(1000);
        ID_LONG.set(1000);
    }
}
